program euler_3variables
implicit none
integer	::	i,j,n
real	::	h=0.05,y=2,z=4,x=0

n=1/h
open(1,file='q4.dat')
	write(1,*)	x,y,z
do	i=1,n
	z=z+h*dz(y,z)
	y=y+h*dy(x,y)
	x=x+h
	write(1,*)	x,y,z
end do


contains
	function	dy(x,y)
	real,	intent(in)	::	x,y
	real				::	dy
	dy	=	-2*y+4*exp(-x)
	end function
	
	function	dz(y,z)
	real,	intent(in)	::	y,z
	real				::	dz
	dz	=	-y*z*z/3
	end function




end program
